export default {
  state: {
    userInfo: {
      name: '一二三',
      age: 18
    }
  },
  mutations: {
    setUserInfo (state, val) {
      state.userInfo = val
    }
  },
  actions: {
    async fetchUserInfo (ctx, params) {
      const res = await ctx.dispatch('fetch', {url: 'https://www.easy-mock.com/mock/5b743dceee973f101f9e982a/example/wangjije/login', params})
      console.log(res)
      ctx.commit('setUserInfo', res.data.data)
    }
  }
}